home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Other Stuff / Demos ƒ / Demo AppMaker / Demo AppMaker™ / Demo AppMaker™.rsrc / TmCT_1013_Popup < prev    next >
Encoding:
Text File  |  1990-03-23  |  1.2 KB  |  54 lines

  1. %case include%
  2.     #include <CPopupMenu.h>
  3. %case instance%
  4.     CPopupMenu        *%itemname%;
  5. %case create%
  6.     
  7.     %itemname% = new (CPopupMenu);
  8.     %itemname%->IViewRes ('PopM', %paneID%, enclosure, supervisor);
  9.     %if not labelName = %
  10.         %itemname%->SetLabelText (%labelName%);
  11.         %labelName%->SetFontNumber (0);    /* System, Chicago */
  12.     %endif%
  13. %case itemNr%
  14.     %DefineItem%
  15. %case dialog field%
  16.     short%        %%fieldname%;
  17.     %haveField%
  18. %case init field%
  19.     info->%fieldname% = 1;
  20. %case auxiliary%
  21.     /*----------*/
  22.     short        x%fieldname%;
  23.     
  24.     /*----------*/
  25.     static pascal void Draw%itemname% (DialogPtr        whichDialog,
  26.                             short            itemNr);
  27.     static pascal void Draw%itemname% (whichDialog, itemNr)
  28.     DialogPtr        whichDialog;
  29.     short            itemNr;
  30.     {
  31.     %if lang = MPW%
  32.     #pragma unused (whichDialog) 
  33.     
  34.     %end if%
  35.         DrawPopup (itemNr, %popupID%, x%fieldname%);
  36.     } /*Draw%itemname%*/
  37.  
  38. %case filter%
  39. %case set%
  40.     x%fieldname% = info->%fieldname%;
  41.     SetUserItem (%itemname%, (ProcPtr) &Draw%itemname%);
  42. %case hit%
  43.     case %itemname%:
  44.             %if not labelName = %
  45.                 InvertLabel (%labelName%);
  46.             %endif%
  47.             DoPopup (%itemname%, %popupID%, &info->%fieldname%);
  48.             x%fieldname% = info->%fieldname%;
  49.             %if not labelName = %
  50.                 InvertLabel (%labelName%);
  51.             %endif%
  52.         break;
  53. %case finish%
  54.